home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / scrnintstr.h,v < prev    next >
Encoding:
Text File  |  1990-02-15  |  8.0 KB  |  244 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.40;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* $XConsortium: scrnintstr.h,v 5.9 89/10/06 14:27:24 keith Exp $ */
  27. /***********************************************************
  28. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  29. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  30.  
  31.                         All Rights Reserved
  32.  
  33. Permission to use, copy, modify, and distribute this software and its 
  34. documentation for any purpose and without fee is hereby granted, 
  35. provided that the above copyright notice appear in all copies and that
  36. both that copyright notice and this permission notice appear in 
  37. supporting documentation, and that the names of Digital or MIT not be
  38. used in advertising or publicity pertaining to distribution of the
  39. software without specific, written prior permission.  
  40.  
  41. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  42. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  43. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  44. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  45. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  46. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  47. SOFTWARE.
  48.  
  49. ******************************************************************/
  50. #ifndef SCREENINTSTRUCT_H
  51. #define SCREENINTSTRUCT_H
  52.  
  53. #include "screenint.h"
  54. #include "miscstruct.h"
  55. #include "region.h"
  56. #include "pixmap.h"
  57. #include "gc.h"
  58. #include "colormap.h"
  59.  
  60.  
  61. typedef struct _PixmapFormat {
  62.     unsigned char    depth;
  63.     unsigned char    bitsPerPixel;
  64.     unsigned char    scanlinePad;
  65.     } PixmapFormatRec;
  66.     
  67. typedef struct _Visual {
  68.     unsigned long    vid;
  69.     short        class;
  70.     short        bitsPerRGBValue;
  71.     short        ColormapEntries;
  72.     short        nplanes;/* = log2 (ColormapEntries). This does not
  73.                  * imply that the screen has this many planes.
  74.                  * it may have more or fewer */
  75.     unsigned long    redMask, greenMask, blueMask;
  76.     int            offsetRed, offsetGreen, offsetBlue;
  77.   } VisualRec;
  78.  
  79. typedef struct _Depth {
  80.     unsigned char    depth;
  81.     short        numVids;
  82.     unsigned long    *vids;    /* block of visual ids for this depth */
  83.   } DepthRec;
  84.  
  85. typedef struct _Screen {
  86.     int            myNum;    /* index of this instance in Screens[] */
  87.     ATOM        id;
  88.     short        width, height;
  89.     short        mmWidth, mmHeight;
  90.     short        numDepths;
  91.     unsigned char          rootDepth;
  92.     DepthPtr           allowedDepths;
  93.     unsigned long          rootVisual;
  94.     unsigned long    defColormap;
  95.     short        minInstalledCmaps, maxInstalledCmaps;
  96.     char                backingStoreSupport, saveUnderSupport;
  97.     unsigned long    whitePixel, blackPixel;
  98.     unsigned long    rgf;    /* array of flags; she's -- HUNGARIAN */
  99.     GCPtr        GCperDepth[MAXFORMATS+1];
  100.             /* next field is a stipple to use as default in
  101.                a GC.  we don't build default tiles of all depths
  102.                because they are likely to be of a color
  103.                different from the default fg pixel, so
  104.                we don't win anything by building
  105.                a standard one.
  106.             */
  107.     PixmapPtr        PixmapPerDepth[1];
  108.     pointer        devPrivate;
  109.     short           numVisuals;
  110.     VisualPtr        visuals;
  111.     int            WindowPrivateLen;
  112.     unsigned        *WindowPrivateSizes;
  113.     unsigned        totalWindowSize;
  114.     int            GCPrivateLen;
  115.     unsigned        *GCPrivateSizes;
  116.     unsigned        totalGCSize;
  117.  
  118.     /* Random screen procedures */
  119.  
  120.     Bool (* CloseScreen)();        /* index, pScreen */
  121.     void (* QueryBestSize)();        /* class, pwidth, pheight */
  122.     Bool (* SaveScreen)();        /* pScreen, on */
  123.     void (* GetImage)();        /* pDrawable, sx, sy, w, h, format, 
  124.                      * planemask, pdestbits */
  125.     void (* GetSpans)();        /* pDrawable, wMax, ppt, pwidth,
  126.                      * nspans, pdstbits */
  127.     void (* PointerNonInterestBox)();    /* pScr, BoxPtr */
  128.  
  129.     void (* SourceValidate)();        /* pDrawable, x, y, w, h */
  130.  
  131.     /* Window Procedures */
  132.  
  133.     Bool (* CreateWindow)();        /* pWin */
  134.     Bool (* DestroyWindow)();        /* pWin */
  135.     Bool (* PositionWindow)();        /* pWin, x, y */
  136.     Bool (* ChangeWindowAttributes)();    /* pWin, mask */
  137.     Bool (* RealizeWindow)();        /* pWin */
  138.     Bool (* UnrealizeWindow)();        /* pWin */
  139.     int  (* ValidateTree)();        /* pParent, pChild, top, anyMarked */
  140.     void (* WindowExposures)();       /* pWin: WindowPtr, pRegion: RegionPtr */
  141.  
  142.     void (* PaintWindowBackground)();    /* pWin, pRgn, which */
  143.     void (* PaintWindowBorder)();    /* pWin, pRgn, which */
  144.     void (* CopyWindow)();        /* pWin, oldPt, pOldRegion */
  145.     void (* ClearToBackground)();    /* pWin, x,y,w,h, sendExpose */
  146.  
  147.     /* Pixmap procedures */
  148.  
  149.     PixmapPtr (* CreatePixmap)();     /* pScreen, width, height, depth */
  150.     Bool (* DestroyPixmap)();        /* pPixmap */
  151.  
  152.     /* Backing store procedures */
  153.  
  154.     void (* SaveDoomedAreas)();        /* pWin, pRegion, dx, dy */
  155.     RegionPtr (* RestoreAreas)();    /* pWin, pRegion */
  156.     void (* ExposeCopy)();        /* pSrc, pDst, pGC, pRegion, */
  157.                     /* srcx, srcy, dstx, dsty, plane */
  158.     RegionPtr (* TranslateBackingStore)();/* pWin, dx, dy, pOldClip */
  159.     RegionPtr (* ClearBackingStore)();    /* pWin, x, y, w, h, sendExpose */
  160.     void (* DrawGuarantee)();        /* pWin, pGC, guarantee */
  161.     
  162.     /* Font procedures */
  163.  
  164.     Bool (* RealizeFont)();        /* pScr, pFont */
  165.     Bool (* UnrealizeFont)();        /* pScr, pFont */
  166.  
  167.     /* Cursor Procedures */
  168.     void (* ConstrainCursor)();       /* pScr, BoxPtr */
  169.     void (* CursorLimits)();        /* pScr, pCurs, BoxPtr, BoxPtr */
  170.     Bool (* DisplayCursor)();        /* pScr, pCurs */
  171.     Bool (* RealizeCursor)();        /* pScr, pCurs */
  172.     Bool (* UnrealizeCursor)();        /* pScr, pCurs */
  173.     void (* RecolorCursor)();        /* pScr, pCurs, displayed */
  174.     Bool (* SetCursorPosition)();    /* pScr, x, y */
  175.  
  176.     /* GC procedures */
  177.  
  178.     Bool (* CreateGC)();        /* pGC */
  179.  
  180.     /* Colormap procedures */
  181.  
  182.     Bool (* CreateColormap)();        /* pcmap */
  183.     void (* DestroyColormap)();        /* pcmap */
  184.     void (* InstallColormap)();        /* pcmap */
  185.     void (* UninstallColormap)();    /* pcmap */
  186.     int (* ListInstalledColormaps) ();     /* pScreen, pmaps */
  187.     void (* StoreColors)();        /* pmap, ndef, pdef */
  188.     void (* ResolveColor)();        /* preg, pgreen, pblue */
  189.  
  190.     /* Region procedures */
  191.  
  192.     RegionPtr (* RegionCreate)();     /* rect, size */
  193.     void (* RegionInit)();        /* pRegion, rect, size */
  194.     Bool (* RegionCopy)();        /* dstrgn, srcrgn */
  195.     void (* RegionDestroy)();        /* pRegion */
  196.     void (* RegionUninit)();        /* pRegion */
  197.     Bool (* Intersect)();        /* newReg, reg1, reg2 */
  198.     Bool (* Union)();            /* newReg, reg1, reg2 */
  199.     Bool (* Subtract)();        /* regD, regM, regS */
  200.     Bool (* Inverse)();            /* newReg, reg1, invRect */
  201.     void (* RegionReset)();        /* pRegion, pBox */
  202.     void (* TranslateRegion)();        /* pRegion, x, y */
  203.     int (* RectIn)();            /* pRegion, pRect */
  204.     Bool (* PointInRegion)();        /* pRegion, x, y, pBox */
  205.     Bool (* RegionNotEmpty)();          /* pRegion: RegionPtr */
  206.     void (* RegionEmpty)();            /* pRegion: RegionPtr */
  207.     BoxPtr (* RegionExtents)();     /* pRegion: RegionPtr */
  208.     Bool (* RegionAppend)();        /* pRegion, pRegion */
  209.     Bool (* RegionValidate)();        /* pRegion, pOverlap */
  210.     RegionPtr (* BitmapToRegion)();    /* PixmapPtr */
  211.     RegionPtr (* RectsToRegion)();    /* nrects, pRects, ordering */
  212.     void (* SendGraphicsExpose)();    /* client, rgn, draw, major, minor */
  213.  
  214.     /* os layer procedures */
  215.     void (* BlockHandler)();        /* data: pointer */
  216.     void (* WakeupHandler)();        /* data: pointer */
  217.     pointer blockData;
  218.     pointer wakeupData;
  219.  
  220.     /* anybody can get a piece of this array */
  221.     DevUnion    *devPrivates;
  222. } ScreenRec;
  223.  
  224. typedef struct _ScreenInfo {
  225.     int        imageByteOrder;
  226.     int        bitmapScanlineUnit;
  227.     int        bitmapScanlinePad;
  228.     int        bitmapBitOrder;
  229.     int        numPixmapFormats;
  230.     PixmapFormatRec
  231.         formats[MAXFORMATS];
  232.     int        arraySize;
  233.     int        numScreens;
  234.     ScreenPtr    screens[MAXSCREENS];
  235. } ScreenInfo;
  236.  
  237. extern ScreenInfo screenInfo;
  238.  
  239. extern int AllocateWindowPrivateIndex(), AllocateGCPrivateIndex();
  240. extern Bool AllocateWindowPrivate(), AllocateGCPrivate();
  241.  
  242. #endif /* SCREENINTSTRUCT_H */
  243. @
  244.